#ifndef LINK_H
#define LINK_H

#include <iostream>
#include <stdexcept>
using namespace std;

typedef int eleType;

typedef struct ListNode
{
    eleType data;//数据域
    ListNode *next;//指针域
    ListNode(eleType x):data(x),next(NULL){};
}Node,*Linknode;

class LinkedList
{
private:
    Linknode head;
    int size;
public:
    LinkedList():head(NULL),size(0){};
    ~LinkedList()
    {
        Linknode curr = head;
        while (curr)
        {
            Linknode temp = curr;
            curr = curr->next;
            delete temp;
        }
    };
    void insert(int i, eleType value);
    void remove(int i);
    Linknode find(eleType value);
    Linknode get(int i);
    void update(int i, eleType value);
    void print();
};






#endif